package com.yjhb.android.sbz.activity.rule;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.yjhb.android.sbz.R;
import com.yjhb.android.sbz.activity.BaseActivity;
import com.jojo.android.zxlib.base.mvp.BasePresenter;
import com.jojo.android.zxlib.view.preview.PreviewBuilder;
import com.jojo.android.zxlib.view.preview.enitity.ImageViewInfo;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 创建者 zx
 * 创建时间 2021/1/8 9:28
 */
public class RuleReport2Activity extends BaseActivity {
    private final String TAG = "RuleReportActivity";
    @BindView(R.id.rules_iv)
    ImageView rules_iv;

    @Override
    protected BasePresenter initPresenter() {
        return null;
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_rule_report2;
    }

    @Override
    protected void initUI() {
        Glide.with(this).load(RuleImg.rulesImgUrl).into(rules_iv);
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void regEvent() {
        rules_iv.setOnClickListener(v -> {
            ImageViewInfo info = new ImageViewInfo(RuleImg.rulesImgUrl);
            v.getGlobalVisibleRect(info.getBounds());
            PreviewBuilder.from(this)
                    .setCurrentIndex(0)
                    .setImg(info)
                    .setDrag(false)
                    .start();
        });
    }

    @OnClick(R.id.back)
    void back() {
        finish();
    }
}
